package com.moss.cloud.base.api.model.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

@Data
public class FlowTaskVO implements Serializable {
    public static final String DATE_FORMAT = "yyyy-MM-dd HH:mm:ss";
    /**数据主键ID*/
    private Long id;
    /*** 流程业务ID*/
    private Long busId;
    /*** 任务ID*/
    private String taskId;
    /**下一个任务节点*/
    private String target;
    /*** 任务名称*/
    private String name;
    /*** 任务节点类型（TASK:任务节点）*/
    private String type;
    /*** 任务节点负责人*/
    private String headUsers;
    /*** 任务节点抄送人*/
    private String ccToUsers;
    /*** 任务节点结束时间*/
    private Long nodeTaskEndTime;
    /*** 任务节点结束时间到期是否自动通过*/
    private Boolean reachEndTimePass;
    /*** 任务节点批复类型（OR:或签，ALL:会签）*/
    private String sign;
    /*** 任务状态（1:未开始，2:进行中，3:通过，4:拒绝）*/
    private Integer status;
    /*** 批复时间*/
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonFormat(pattern = DATE_FORMAT)
    private LocalDateTime applyTime;
    /*** 批复意见*/
    private String applyOpinion;
    /***任务节点负责人其他信息*/
    private List<ApprovalUser> approvalUsers;
    /***任务节点抄送人其他信息*/
    private List<ApprovalUser> ccUsers;
    /***备注*/
    private String desc;
    /**是否申请人*/
    private Boolean isApplicant;

    @Data
    public static class ApprovalUser implements Serializable{
        /***用户ID*/
        private Long id;
        /***用户姓名*/
        private String name;
        /***头像*/
        private String avatar;
    }
}
